#include "main.h"

void recv_msg(int netFD, sendc_t *sc){

    int command_num = sc->num;
    int res;
    int ret = recv(netFD, &res, sizeof(res), MSG_WAITALL);
    ERROR_CHECK(ret, -1, "recv_recvMsg");

    if(res == 1){
        switch(command_num){
        case 1:
        case 4:
        case 7:
        case 8:
            printf("操作成功\n");
            break;
        case 2:
            command_ls(netFD);
            break;
        case 3:
            command_pwd(netFD);
            break;
        case 5:
            command_puts(netFD, sc);
            break;
        case 6:
            command_gets(netFD, sc);
            break;
        }
    }else{
        if(command_num == 2){
            printf("\n");
            return;
        }
        printf("操作失败\n");
    }

}
